﻿using System;
using System.Collections.Generic;
using System.Text;
using AudioPlayer.Plugin.Storage;

namespace AudioPlayer.Plugin.Playback {
	public interface IPlayControl : IPlugin {
		#region Voids
		/// <summary>
		/// User requested to play.
		/// </summary>
		void Play();
		/// <summary>
		/// User requested to play this item
		/// </summary>
		/// <param name="item">The song.</param>
		void Play(ISong item);

		/// <summary>
		/// User requested to play this url.
		/// </summary>
		/// <param name="url">The URL.</param>
		void Play(String url);

		/// <summary>
		/// User requested to play next item in current playlist.
		/// </summary>
		void Next();

		/// <summary>
		/// User requested to play previously item
		/// </summary>
		void Prev();

		/// <summary>
		/// User requested to stop playback
		/// </summary>
		void Stop();

		/// <summary>
		/// Seeks the specified percent.
		/// </summary>
		/// <param name="perc">The percent.</param>
		/// <param name="seek">Options.</param>
		void Seek(int perc, System.IO.SeekOrigin seek);
		/// <summary>
		/// Pause currently playback
		/// </summary>
		void Pause();
		#endregion
		#region Property
		/// <summary>
		/// Gets or sets the active playlist.
		/// </summary>
		/// <value>The playlist.</value>
		IPlaylist Playlist { get; set; }

		/// <summary>
		/// Gets the active song.
		/// </summary>
		/// <value>The active.</value>
		ISong Active { get; }

		/// <summary>
		/// Gets a value indicating whether this instance is playing.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is playing; otherwise, <c>false</c>.
		/// </value>
		bool IsPlaying { get; }

		/// <summary>
		/// Gets the duration.
		/// </summary>
		/// <value>The duration.</value>
		double Duration { get; }

		/// <summary>
		/// Gets the current position.
		/// </summary>
		/// <value>The current position.</value>
		double Current { get; }
		#endregion
		#region Events
		/// <summary>
		/// Occurs when playback starts
		/// </summary>
		event EventHandler Starting;
		/// <summary>
		/// Occurs when playback ends
		/// </summary>
		event EventHandler Ending;
		#endregion
	}
}
